Close Confirmation Dialog
fun CloseConfirmationDialog(_: Nothing = nothing, modifier: Modifier = Modifier, icon: @Composable () -> Unit? = {
Icon(imageVector = IconPack.CloudAlertOutline, contentDescription = null)
}, title: @Composable () -> Unit? = {
Text(text = stringResource(R.string.ly_img_editor_dialog_close_confirm_title))
}, text: @Composable () -> Unit? = {
Text(text = stringResource(R.string.ly_img_editor_dialog_close_confirm_text))
}, onDismissRequest: () -> Unit = {
showCloseConfirmationDialog = false
}, confirmButton: @Composable () -> Unit = {
TextButton(
onClick = {
onDismissRequest()
editorContext.eventHandler.send(EditorEvent.CloseEditor())
},
) {
Text(stringResource(R.string.ly_img_editor_dialog_close_confirm_button_confirm))
}
}, dismissButton: @Composable () -> Unit? = {
TextButton(
onClick = onDismissRequest,
) {
Text(stringResource(R.string.ly_img_editor_dialog_close_confirm_button_dismiss))
}
}, properties: DialogProperties = DialogProperties(dismissOnBackPress = false, dismissOnClickOutside = false), __: Nothing = nothing)
A helper composable function for displaying a confirmation dialog when closing the editor.
Parameters
modifier
the modifier to apply to the dialog.
icon
the icon to display in the dialog.
title
the title of the dialog.
text
the text of the dialog.
confirm Button
the confirm button of the dialog.
dismiss Button
the dismiss button of the dialog.
on Dismiss Request
executes when the user tries to dismiss the dialog.
properties
the properties of the dialog.